In a typical file system, caching file blocks in the volatile memory of a server when a file is written to the server poses a problem when the server crashes. The server is exposed to losing cached data during a reboot of the system. If the server had already reported the successful completion of the copy operation, the client would not know whether the data actually made it to persistent storage before the crash. Thus, many file systems require that data associated with write operations to be stored at a non-volatile storage location before the server can report successful completion of the write operation.
The Network File System (NFS) protocol, for example, requires that all operations that modify the filesystem be synchronously written to non-volatile storage before the completion of the write operation is acknowledged. Because of the relative slowness of disk operations, NFS write operations incur an undesirable amount of delay. A synchronous write typically requires at least two disk writes: one for the new data for a file and one for the control information associated with the file. In UNIX, updating the control information includes changing the file size indicated in the inode associated with the file, and storing data indicating the blocks where the new file data is stored ("file block pointers"). For a file larger than 12 data blocks, an additional disk write is required to write the file block pointers to an indirect index block located separate from the inode.
In NFS, file transfer rates are greatly affected by the disk seek time (the time to move the arm containing a read/write head to the desired track on the disk). Since data blocks containing new file data, inodes containing file information, and indirect index blocks containing data block pointers are located at different areas of the disk, additional time is required for the synchronous write when an additional disk write is required to write the file block pointers to an indirect index block. This delay severely restricts the write throughput available from a given server.
Thus, what is needed is an apparatus and method for reducing the number of disk I/O operations required to perform writes without sacrificing the safeguards provided by the requirement that completion of a synchronous write operation cannot be acknowledged until the data is stored on non-volatile storage.